package com.genexususa.eo.google.test.sync;

import com.genexususa.eo.google.connection.ReportManager;
import com.genexususa.eo.google.connection.SyncManager;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

/**
 * Created by genexus on 11/3/2014.
 */
public class ConsumeGetTotalReportForClientExc {

    public static void main(String[] args){

        String clientIds = "8862333481;7296664881;6564212367;7708609287;9249936555;3749532414;2159834512;9213145906;1314349887;3134813912;4381632961;7727473163;4046938125;1424651427;6431563602;6388046129;9997248953;9108441783;3259648263;1809137378;2934043378;1569289721;2381915253;3003461785;7517456653;5831634832;4864699675;5430454602;2891328179;5712241195;";

        SyncManager sm = new SyncManager();

        sm.GetTotalReportForClientsExc(clientIds, "c:\\l2t", 1000L, 1);
        /*try {
            Long start = System.currentTimeMillis();

            ArrayList<String> records = new ArrayList<String>();
            BufferedReader reader = new BufferedReader(new FileReader("c:\\l2t\\clients2.txt"));
            String line;
            while ((line = reader.readLine()) != null) {
                records.add(line);

            }
            reader.close();


            for (String l : records) {

                SyncManager sm = new SyncManager();

                sm.GetTotalReportForClientsExc(l, "c:\\l2t", 1000L, 1);
            }

            Long end = System.currentTimeMillis();

            System.out.println(String.format("%d min, %d sec",
                    TimeUnit.MILLISECONDS.toMinutes(end - start),
                    TimeUnit.MILLISECONDS.toSeconds(end - start) -
                            TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(end - start))
            ));

        }catch (Exception e){
            e.printStackTrace();
        }
           */

    }
}
